<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>常见布局技巧-margin负值</title>
    <style>
        li {
            list-style: none;
        }
        
        ul li {
            position: relative;
            float: left;
            width: 200px;
            height: 300px;
            text-align: center;
            line-height: 300px;
            border: 1px solid red;
            margin-left: -1px;
        }
        /* 增加 边框hover效果，通过加相对定位来提升优先级，如果已经有定位，则加z-index来提升 */
        
        ul li:hover {
            /* position: relative; */
            z-index: 1;
            border-color: green;
            color: green;
        }
    </style>
</head>

<body>
    <!-- 1.margin负值和边框hover效果 -->
    <ul>
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
    </ul>
</body>

</html>